from blog_app.models import User
class myMid:
    def process_request(self,request):
        #判断session中是否有值
        print('process_request')
        userid = request.session.get('userinfo', None)
        if userid:
            user = User.objects.get(userId=userid)
            print(user)
            request.user_object = user
            return
